package mhcs.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ClickEvent;

public class Logout extends Composite{
	public Logout() {
		
		FlexTable flexTable = new FlexTable();
		initWidget(flexTable);
		
		Button btnLogoutOfMhcs = new Button("Logout of MHCS");
		btnLogoutOfMhcs.setStyleName("gwt-Buttons");
		btnLogoutOfMhcs.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				
				//MHCS.soundOutput.actionPerformed("logout", new Module(0, "", "", 0, 0, 0));
				MHCS.soundOutput.playSound4();
				
				RootPanel.get().clear();

			    LoginPopup loginPopup = new LoginPopup();
			    RootPanel.get().add(loginPopup);
			    
			    //Run the save function after we implement it
				
			}
		});
		flexTable.setWidget(0, 0, btnLogoutOfMhcs);
		btnLogoutOfMhcs.setSize("150px", "35px");
	}

}
